package com.atguigu.gmall.user.controller;

import com.atguigu.gmall.beans.UmsMember;
import com.atguigu.gmall.service.UserService;
import com.atguigu.gmall.beans.UmsMemberReceiveAddress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: xuwang
 * @Date: 2019/12/19 14:39
 * @Version: 1.0
 */

@RestController
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping("/getAllMember")
    public List<UmsMember> getAllMember(){
        List<UmsMember> memberList=userService.getAllMember();
        return memberList;
    }

    @RequestMapping("/getReceiveAddressByMemberId")
    public List<UmsMemberReceiveAddress> getReceiveAddressByMemberId(String memberId){
        List<UmsMemberReceiveAddress> addressList=userService.getReceiveAddressByMemberId(memberId);
        return addressList;
    }



    @RequestMapping("/test")
    public String test(){
        return "今天天气真好";
    }
}
